package com.duke.shaking.profile;

import java.util.List;

import com.duke.shaking.R;
import com.duke.shaking.pojo.UserImage;
import com.duke.shaking.widget.GalleryAdapter;
import com.duke.shaking.widget.GalleryView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Gallery;

public class ViewPhotosActivity extends Activity {
	public static final String EXTRA_IMAGES = "images";
	private Gallery galleryView;
	
	public ViewPhotosActivity() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_gallery);
		
		Intent i = getIntent();
		List<UserImage> imageList = (List<UserImage>)i.getSerializableExtra(EXTRA_IMAGES);
		
		this.galleryView = (Gallery)this.findViewById(R.id.gallery);
		this.galleryView.setFadingEdgeLength(0);
		GalleryAdapter adapter = new GalleryAdapter(this, imageList);
		this.galleryView.setAdapter(adapter);
	}

	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		this.finish();
	}
	
}
